#ifndef B2_COMMON_H
#define B2_COMMON_H

#include <map>
#include <string>
#include <vector>

#include "Box2D.h"

/* max/msp stuff */
#include "ext.h"
#include "ext_common.h"
#include "ext_obex.h"
#include "ext_path.h"

#define PIXELS_PER_METER 50 /* just decide it's 100 */ // previously 100, 50 allows smaller polys, no problems yet.
#define METERS_PER_PIXEL 0.02f
#define P2M(PIXELS) \
		PIXELS * METERS_PER_PIXEL
#define M2P(METERS) \
		METERS * PIXELS_PER_METER

/* to move Box2D radians into OpenGL degrees */
#define D2R(DEGREES) \
	DEGREES*0.01745329251994f // DEGREES * PI / 180
#define R2D(RADIANS) \
	RADIANS*57.295779513082322f // RADIANS * 180 / PI

/* will take any radians and place them into 0-360 degrees */
#define MOD_R2D(RADIANS) \
	(RADIANS % 2_PI) *57.295779513082322f // RADIANS * 180 / PI



#define EQUALS(STR0,STR1) strcmp(STR0,STR1) == 0

/* helper functions */
float randomrange(float x, float y);

#endif